<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>天朝</title>
<%@include file="/view/common/js-css.jsp"%>
</head>
<body>
	<center>
		<h1>个人忘记密码</h1>
	</center>
	<div class="container">
	<form class="form-horizontal" role="form"
		action="<%=request.getContextPath()%>/TalentServlet?command=forgetPassword" method="post" onsubmit="return validate();">
		<div class="form-group">
		<label for="name" class="col-sm-2 control-label" style="margin-left:-80px;">账号</label>
			<div class="col-sm-10">
				<input type="text" class="form-control" name="code" placeholder="请输入要找回密码的账号" id="code">
			</div>
		<span id="codeInfo" class="bg-danger text-muted"></span></div>
		<div class="form-group">
		<label for="name" class="col-sm-2 control-label" style="margin-left:-80px;">邮箱</label>
			<div class="col-sm-10">
				<input type="text" class="form-control" name="email" placeholder="请输入您的邮箱地址" id="email">
			</div>
		<span id="emailInfo" class="bg-danger text-muted"></span></div>
		<div class="form-group">
			<div class="col-sm-offset-2 col-sm-10"">
				<button type="submit" class="btn btn-default">发送</button>
				 <input type="button" class="btn btn-primary" onclick="javascript:history.back();" value="返回"/>
			</div>
		</div>
	</form>
	</div>
	<script>
			/**
			 * 表单验证
			 */
			function validate() {
				var result = true;
				var code = document.getElementById("code");
				var email = document.getElementById("email");
				if(code.value == ''){
					document.getElementById("codeInfo").innerHTML="账号不能为空";
					result = false;
				}else{
					document.getElementById("codeInfo").innerHTML="";
				}
				if(email.value == ''){
					document.getElementById("emailInfo").innerHTML="邮箱不能为空";
					result = false;
				}else{
					document.getElementById("emailInfo").innerHTML="";
				}
				return result;
			}
			/**
			*el获取是否修改成功信息(相当于request.getParameter(arg0))
			*/
			if('${param.updateSuccess}'){
				layer.msg('发送成功！',{icon:1});
			}
			if('${param.updateError}'){
				layer.msg('发送失败！',{icon:0});
			}
			
		</script>
</body>
</html>